import axios from 'axios'
const request = axios.create({
  baseURL:'http://127.0.0.1:8888/api/private/v1',
  timeout: 1000 * 10,
})

request.interceptors.request.use(config => {
  const token = sessionStorage.getItem('TOKEN');
  if(token){
    config.headers['Authorization'] = token
  }
  return config;
})

request.interceptors.response.use(res => {
  return res.data;
})

export default request;
